/*
 * @Description: 主题配置
 * @Author: iamsmiling
 * @Date: 2021-05-23 08:47:40
 * @LastEditTime: 2021-06-13 15:54:14
 */

import 'dart:ui';
// ignore: import_of_legacy_library_into_null_safe
import 'package:credit_business_circle/components/indicator/fixed_size_tab_indicator.dart';
import 'package:flutter/material.dart';

import 'R.dart';

class RTheme {
  static RTheme _singleton = RTheme._();
  // ignore: unused_element
  RTheme._();
  factory RTheme() => _singleton;
  final ThemeData lightTheme = ThemeData(
      primaryColor: R.color.ff2eab86,
      highlightColor: R.color.transparent,
      splashColor: R.color.transparent,
      textSelectionTheme: TextSelectionThemeData(cursorColor: R.color.ff2eab86),
      scaffoldBackgroundColor: R.color.fff5f5f5,
      tabBarTheme: TabBarTheme(
          indicatorSize: TabBarIndicatorSize.tab,
          labelStyle: TextStyle(
              color: R.color.ff333333,
              fontSize: R.dimen.sp15,
              fontWeight: FontWeight.w600),
          labelColor: R.color.ff333333,
          unselectedLabelStyle: TextStyle(
              color: R.color.ff888888,
              fontSize: R.dimen.sp15,
              fontWeight: FontWeight.w500),
          unselectedLabelColor: R.color.ff888888,
          indicator: FixedSizeUnderlineTabIndicator(
              borderSide: BorderSide(width: 3, color: R.color.ff00c2ba))),
      inputDecorationTheme: InputDecorationTheme(
          fillColor: R.color.fff5f5f5,
          isCollapsed: true,
          isDense: true,
          border: InputBorder.none,
          focusedBorder: InputBorder.none,
          enabledBorder: InputBorder.none,
          hintStyle: TextStyle(
            color: R.color.ffababab,
            fontSize: R.dimen.sp13,
          )),
      textTheme: TextTheme(bodyText1: TextStyle(color: R.color.ff333333)),
      appBarTheme: AppBarTheme(
          centerTitle: true,
          textTheme: TextTheme(
            headline6: TextStyle(
                color: R.color.ff444444,
                fontSize: R.dimen.sp16,
                fontWeight: FontWeight.w600),
          ),
          iconTheme: IconThemeData(color: R.color.ff222222),
          foregroundColor: R.color.ff444444,
          titleTextStyle: TextStyle(
              color: R.color.ff444444,
              fontSize: R.dimen.sp16,
              fontWeight: FontWeight.w600),
          elevation: 1,
          backgroundColor: R.color.fffcfcfc),
      floatingActionButtonTheme: FloatingActionButtonThemeData(
          elevation: 0, backgroundColor: R.color.transparent),
      bottomNavigationBarTheme: BottomNavigationBarThemeData(
        elevation: 0,
        backgroundColor: R.color.ffffffff,
        showSelectedLabels: true,
        showUnselectedLabels: true,
        selectedItemColor: R.color.ff2eab86,
        selectedLabelStyle: TextStyle(fontSize: R.dimen.sp10),
        type: BottomNavigationBarType.fixed,
        unselectedLabelStyle:
            TextStyle(fontSize: R.dimen.sp10, color: R.color.ff888888),
      ),
      dialogTheme: DialogTheme(
          backgroundColor: R.color.ffffffff,
          shape: RoundedRectangleBorder(
              borderRadius: BorderRadius.circular(R.dimen.sp8))),
      elevatedButtonTheme: ElevatedButtonThemeData(
          style: ButtonStyle(
              padding: MaterialStateProperty.all(
                  EdgeInsets.symmetric(vertical: R.dimen.dp13)),
              elevation: MaterialStateProperty.all(0),
              overlayColor: MaterialStateProperty.all(R.color.transparent),
              shape: MaterialStateProperty.all(StadiumBorder()),
              foregroundColor: MaterialStateProperty.all(Colors.white),
              backgroundColor: MaterialStateProperty.all(R.color.ff36ba93),
              minimumSize: MaterialStateProperty.all(
                  Size(R.dimen.width, R.dimen.dp40)))),
      textButtonTheme: TextButtonThemeData(
          style: ButtonStyle(
        // padding: MaterialStateProperty.all(
        //     EdgeInsets.symmetric(vertical: R.dimen.dp13)),
        elevation: MaterialStateProperty.all(0),
        textStyle: MaterialStateProperty.all(
            TextStyle(color: R.color.ff666666, fontSize: R.dimen.sp12)),
        // overlayColor: MaterialStateProperty.all(R.color.transparent),
        foregroundColor: MaterialStateProperty.all(R.color.ff666666),
        backgroundColor: MaterialStateProperty.all(R.color.transparent),
      )));
}
